<?php 
include("header.html");

require_once ('mysql_connect.php');

//Searching for a garment

if (isset($_GET['gid'])){
$gid = (int) $_GET['gid'];
if ($gid > 0){
	$query = "SELECT 
		g_name, g_description, g_price FROM garments ORDER by g_garment_id";
}

//Table

echo '<table border ="1" width="90%" cellspacing="3" cellpadding="3" align="center">
<tr>
<td align="left" width="20%><b>Name</b></td>
<td align="left" width="20%><b>Description</b></td>
<td align="right" width="20%><b>Price</b></td>
</tr>';

$result = mysql_query ($dbc, $query);
while ($row = mysql_fetch_array
	($result, MYSQL_ASSOC)) {
echo " <tr>
	<td align=\"left\">gid={$row['g_garment_id']}\">{$row
	['g_name']}</a></td>
	<td align=\"left\">{$row
	['g_description']}\"></td>
	<td align =\"right\">\${$row
	['g_price']}</td>
	</tr>\n";
	
	
	}//End of While Loop
	
	echo '</table>'; //Close Table
	
	mysql_close($dbc); //Close Database Connection
	
	include("footer.html");
	
	?>